package com.sj.parksdk.net.result.databean;

import com.sj.parksdk.net.base.Page_Data;
import com.xuexiang.xutil.common.StringUtils;

import java.math.BigDecimal;

public class Data_NearbyPark  extends Page_Data<Data_NearbyPark>{

    /**
     * id : 115
     * name : 淮安七星水岸
     * code : p200592542
     * merchantName : 东莞市创顺防静电科技有限公司
     * category : 1
     * status : 0
     * thumbImage : http://121.37.139.73:8888/group1/M00/00/00/wKgAMl8VSdWAGcxHAABA6Uq4mpM157.jpg
     * image : http://121.37.139.73:8888/group1/M00/00/00/wKgAMl8VSdWAJH7eAAFK1-H71sU210.jpg
     * remainSpace : 198
     * totalSpace : 200
     * address : 淮安市淮安区京东路131号
     * latitude : 33.597507
     * longitude : 119.03485
     * areaName : 淮安区
     * distance : 0
     * chargeStandard:""收费标准说明
     */

    private long id;
    private String name;
    private String code;
    private String merchantName;
    private int category;
    private int status;
    private String thumbImage;
    private String image;
    private int remainSpace;
    private int totalSpace;
    private String address;
    private double latitude;
    private double longitude;
    private String areaName;
    private double distance;
    private String chargeStandard;

    public String getChargeStandard() {
        return StringUtils.isEmpty(chargeStandard)?"--":chargeStandard;
    }

    public Data_NearbyPark setChargeStandard(String chargeStandard) {
        this.chargeStandard = chargeStandard;
        return this;
    }

    public long getId() {
        return id;
    }

    public Data_NearbyPark setId(long id) {
        this.id = id;
        return this;
    }

    public String getName() {
        return name;
    }

    public Data_NearbyPark setName(String name) {
        this.name = name;
        return this;
    }

    public String getCode() {
        return code;
    }

    public Data_NearbyPark setCode(String code) {
        this.code = code;
        return this;
    }

    public String getMerchantName() {
        return merchantName;
    }

    public Data_NearbyPark setMerchantName(String merchantName) {
        this.merchantName = merchantName;
        return this;
    }

    public int getCategory() {
        return category;
    }

    public Data_NearbyPark setCategory(int category) {
        this.category = category;
        return this;
    }

    public int getStatus() {
        return status;
    }

    public Data_NearbyPark setStatus(int status) {
        this.status = status;
        return this;
    }

    public String getThumbImage() {
        return thumbImage;
    }

    public Data_NearbyPark setThumbImage(String thumbImage) {
        this.thumbImage = thumbImage;
        return this;
    }

    public String getImage() {
        return image;
    }

    public Data_NearbyPark setImage(String image) {
        this.image = image;
        return this;
    }

    public int getRemainSpace() {
        return remainSpace;
    }

    public Data_NearbyPark setRemainSpace(int remainSpace) {
        this.remainSpace = remainSpace;
        return this;
    }

    public String getTotalSpace() {
        return "总泊位:"+totalSpace;
    }

    public Data_NearbyPark setTotalSpace(int totalSpace) {
        this.totalSpace = totalSpace;
        return this;
    }

    public String getAddress() {
        return StringUtils.isEmpty(address)?"":address;
    }

    public Data_NearbyPark setAddress(String address) {
        this.address = address;
        return this;
    }

    public double getLatitude() {
        return latitude;
    }

    public Data_NearbyPark setLatitude(double latitude) {
        this.latitude = latitude;
        return this;
    }

    public double getLongitude() {
        return longitude;
    }

    public Data_NearbyPark setLongitude(double longitude) {
        this.longitude = longitude;
        return this;
    }

    public String getAreaName() {
        return areaName;
    }

    public Data_NearbyPark setAreaName(String areaName) {
        this.areaName = areaName;
        return this;
    }

    public double getDistance() {
        return distance;
    }

    public String getDistanceStr(){
        if(distance>1000)return new BigDecimal(distance/1000).setScale(1,BigDecimal.ROUND_HALF_UP).toString() +"km";
        return Math.round(distance) +"m";
    }

    public Data_NearbyPark setDistance(double distance) {
        this.distance = distance;
        return this;
    }
}
